package com.cashmama.market.api.infras.enums.message;

/**
 * @program: market-api
 * @description
 * @author: frank
 * @create: 2019-12-20 14:54
 **/
public enum AppTypeEnum {
    DHANADHAN(1, "DhanaDhan", "DhanaDhan");
    private Integer type;
    private String flag;
    private String name;

    AppTypeEnum(Integer type, String flag, String name) {
        this.type = type;
        this.flag = flag;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public AppTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getName() {
        return name;
    }

    public AppTypeEnum setName(String name) {
        this.name = name;
        return this;
    }

    public String getFlag() {
        return flag;
    }

    public AppTypeEnum setFlag(String flag) {
        this.flag = flag;
        return this;
    }

    public static String getFlag(Integer type) {
        String flag = "";
        for (AppTypeEnum enums : AppTypeEnum.values())
            if (enums.getType() == type) {
                flag = enums.getFlag();
                break;
            }
        return flag;
    }
}
